package file;

import java.io.*;

/**
 * 修改文件内容（字符串替换）
 * 读一行 写一行到新文件
 * Created by Zhou_Bing on 2019/8/29.
 */
public class Update {

    public static void main(String[] args){

        try {
            BufferedReader br = new BufferedReader(new FileReader("D:/eqm_sta_maintain_schedule.sql"));
            BufferedWriter bw = new BufferedWriter(new FileWriter("D:/eqm_sta_maintain_schedule_temp.sql"));
            String line = null;
            int i=0;
            while((line=br.readLine())!=null){
                bw.write(line.replace("`eqm_sta_maintain_schedule` ","`eqm_sta_maintain_schedule` (`ID`, `WO_NO`, `MAINTAIN_TYPE`, `STA_ID`, `STA_NUM`, `STA_NAME`, `EQUIPMENT_TYPE`, `STA_ORG_CODE`, `STA_ORG_NAME`, `PLAN_START_TIME`, `PLAN_END_TIME`, `IS_FINISH`, `IS_ONTIME`, `PROVINCE`, `CITY`, `TOWN`, `CREATE_TIME`, `ACTUAL_END_TIME`, `SYNC_FLAG`, `EQUIPMENT_MODEL`, `EQUIPMENT_MODEL_NAME`, `ACTUAL_START_TIME`, `EQUIPMENT_TYPE_DETAIL`, `EQUIPMENT_TYPE_NAME`) ")+"\n");
                System.out.println(i++);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }


    }

}
